import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/home/home.vue'
import Index from '@/views/home/index.vue'
import Cla from '@/views/home/cla.vue'
import Cart from '@/views/home/cart.vue'
import My from '@/views/home/my.vue'
import register from '@/views/register/index.vue'
import login from '@/views/login/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {path:'/',redirect:'/login'},
    {path: '/home',component: HomeView,    children:[
      {path:'index',component:Index},
      {path:'cla',component:Cla},
      {path:'cart',component:Cart},
      {path:'my',component:My},
      
    ]},
    {path:'/login',component:login},
    {path:'/register',component:register},
  ],
})

export default router
